package com.etc.reg;

/**
 * @author: knowno
 * @create: 2024-09-09 17:12
 * @Version 1.0
 **/
public class TestReg {
    public static void main(String[] args) {

        //我们采用 字符串直接复制来定义一个正则
        String reg = "^\\d{6}$";
        //字符串很多方法都支持正则验证
        String str = "12a456";

        // matches
        boolean matches = str.matches(reg);
        System.out.println(matches);

    }
}
